/*
 * @(#)VersionType.java
 *
 *
 *
 * ver 1.0 Aug 16, 2007 ggranum
 */
package org.testfire.model;

import org.testfire.translator.TranslatorFactory;
import org.w3c.dom.Element;

public class VersionType implements TestFireObject
{
    int major;
    int minor;
    String differentiator = "";

    private final Element element;

    private TestFireObject parent;

    public VersionType(Element el, String differentiator)
    {
        this.element = el;
        this.differentiator = differentiator;
    }

    public void setParent( TestFireObject parent )
    {
        this.parent = parent;
    }

    public TestFireObject getParent()
    {
        return parent;
    }


    public Object translate( TestsetType testset )
    {
        return TranslatorFactory.translate(testset, this);
    }

    public int getMajor()
    {
        return Integer.parseInt( element.getAttribute( "major" ));
    }

    public int getMinor()
    {
        return Integer.parseInt( element.getAttribute( "minor" ) );
    }

    public String getDifferentiator()
    {
        return differentiator;
    }
}

// eof: VersionType.java